import { addTeaZxTcOrder } from '@/api/xlzx/index'
export default{
	data(){
		return{
			againOrderFlag:false
		}
	},
	methods:{
		addTcOrder(field,currOpt,fromPage){
			addTeaZxTcOrder(field).then(res=>{
				let tmpRes = res.data.datas;
				let { teaHeadImg,tcName,teaUserName,orderMoney,orderId,addTime,orderNoLocal,tcTimes } = tmpRes;
				let zxTcInfoField = { teaImg:teaHeadImg,tcName,teaName:teaUserName,actMoney:orderMoney,addTime,orderNoLocal,tcTimes };
				uni.setStorageSync('zxTcInfoField',zxTcInfoField);
				this.comJumpOrderPay(orderId,currOpt,fromPage);
			}).catch(err=>{
				//console.log(err) 
			})
		},
		comJumpOrderPay(orderId,currOpt,fromPage){
			//zxTcPay zxTcPayOrder
			uni.navigateTo({
				url:'/pages/subIndex/orderPay/orderPay?orderId=' + orderId + '&fromPage='+ fromPage +'&jfTag=0',
				success:()=>{
					if(currOpt == 'againBuyList'){//咨询套餐订单list againBuyDet(套餐订单详情)
						this.againOrderFlag = true;
					}
				}
			})
		}
	}
}